from Base.read_json import Data

import pytest, logging


def value():
    data = Data.get_json_data("data_2.json")
    data_list = []
    for i in data:
        data_list.append((i.get("a"), i.get("b"), i.get("c"), i.get("desc")))
    return data_list


class TestSum:

    @pytest.mark.parametrize("a,b,c,desc", value())
    def test_sum(self, a, b, c, desc):
        logging.info("\n用例类型是：{}".format(desc))
        logging.info("\n{}+{}=={}".format(a, b, c))
        # print("\n用例类型是：{}".format(desc))
        # print("\n{}+{}=={}".format(a, b, c))
        assert a + b == c
